package com.lakeworks.web.controller.core;

import com.lakeworks.common.core.controller.BaseController;
import com.lakeworks.common.core.domain.AjaxResult;
import com.lakeworks.service.ISysDefectiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * lakeController
 *
 * @author lake
 * @date 2023-02-10
 */
@RestController
@RequestMapping("/system")
public class SysDefectiveController extends BaseController {
    @Autowired
    private ISysDefectiveService sysDefectiveService;

    /**
     * 查询瑕疵列表
     */
    @GetMapping("/defectives")
    public AjaxResult list() {
        return success(sysDefectiveService.defectiveList());
    }

    @GetMapping("/defective/{id}")
    public AjaxResult selectById(@PathVariable("id") Long id) {
        return success(sysDefectiveService.defectiveById(id));
    }

    /**
     * 查询瑕疵列表
     */
    @GetMapping("/risk")
    @ResponseBody
    public AjaxResult riskList() {
        return success(sysDefectiveService.selectSysRiskList());
    }

}
